<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        function Person(){
            this.z = "admin";
        }
        Person.prototype = {
            name:"张三",
            age:20,
            sex:"男"
        }
        let person = new Person();
        function User(){
            this.name = "李四";
            this.age = 28;
        }
        User.prototype = person; // User继承person的原型
        let user = new User();
        console.log(user);

    </script>
</body>
</html>